#pragma once
#ifndef _WGUI_OBJECT_
#define _WGUI_OBJECT_

#include "Framework.hpp"

class WGuiObject
{
protected:
	inline WGuiObject(WGuiObject& _Object)noexcept
		: m_ObjParent(&_Object)
		, m_ObjChild(nullptr)
		, m_ChildCount(0)
	{
		_Object.m_ObjChild = this;
		_Object.m_ChildCount++;
	}

	inline ~WGuiObject()noexcept
	{}

	virtual void SetParent(WGuiObject& _Object)noexcept
	{
		m_ObjParent = &_Object;
		m_ObjParent->m_ObjChild = this;
	}

	virtual WGuiObject& GetParent()noexcept
	{
		return *m_ObjParent;
	}

	virtual WGuiObject& GetChild()noexcept
	{
		return *m_ObjChild;
	}

private:
	WGuiObject*		m_ObjParent;
	WGuiObject*		m_ObjChild;
	unsigned int	m_ChildCount;
};


#endif // !_WGUI_OBJECT_
